package com.example.androiddemo

import android.content.Intent
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.embedding.engine.FlutterEngineCache
import io.flutter.plugin.common.MethodChannel

class MainActivity: FlutterActivity() {
    private val ENGINE_ID = "my_engine_id"
    companion object {
        private const val CHANNEL = "samples.flutter.dev/router"
    }

    override fun configureFlutterEngine(flutterEngine: FlutterEngine){
        super.configureFlutterEngine(flutterEngine)

        FlutterEngineCache.getInstance().put(ENGINE_ID,flutterEngine)
        MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL)
            .setMethodCallHandler{ call, _ ->
                if(call.method=="routerNative"){
                    startActivity(Intent(this,))
                }
            }
    }
}
